package tests;

import junit.framework.TestCase;
import server.Room;
import client.ConsoleUI;

import common.IUI;
import common.Profile;

public class RoomTest extends TestCase {

    IUI p1;
    IUI p2;
    IUI p3;
    IUI p4;
    Room room;
    Profile profile;
    
    protected void setUp() throws Exception {
        super.setUp();
    
        p1 = new ConsoleUI();
        p2 = new ConsoleUI();
        p3 = new ConsoleUI();
        p4 = new ConsoleUI();
        profile = new Profile("Dan", "pass", "email@");
        profile.increaseRating(10);
        room = new Room(profile, p1, 3);
    
               
    }
    
    public void testRoom() {
        assertEquals(room.getClients().size(), 1);
        
    }
    
    public void testAddToRoom() {
        room.addToRoom(new Profile("Nir", "pass", "email@"), p2);
        assertEquals(room.getClients().size(), 2);
        
        
        room.addToRoom(new Profile("Ran", "pass", "email@"), p3);
        assertEquals(room.getClients().size(), 3);
        
        
        room.addToRoom(new Profile("Alon", "pass", "email@"), p4);
        assertEquals(room.getClients().size(), 3);
        
    }

}
